package com.tangding.hprose.api.server.command.impl.watch;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.tangding.cache.UserWatchingCache;
import com.tangding.common.exception.GException;
import com.tangding.hprose.api.server.command.Command;
import com.tangding.hprose.api.server.command.Response;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年12月14日_上午10:13:35
 *
 */
@Component
public class WatchingUsers implements Command {

	@SuppressWarnings("unchecked")
	@Override
	public Response exe(Object... params) throws GException {
		@SuppressWarnings("rawtypes")
		Map<String, Object> map = (Map) params[0];
		String admin = (String) map.get("admin");
		List<Object> list = (List<Object>) map.get("uids");
		UserWatchingCache.push(admin, list);
		return doResponseSucc(true);
	}

}
